/*
* Copyright 2016 Yonyou Auto Information Technology（Shanghai） Co., Ltd. All Rights Reserved.
*
* This software is published under the terms of the YONYOU Software
* License version 1.0, a copy of which has been included with this
* distribution in the LICENSE.txt file.
*
* @Project Name : marketing-dealerApp-open-api
*
* @File name : DealerAppLoginController.java
*
* @Author : WangHuicheng
*
* @Date : 2016年11月9日
*
----------------------------------------------------------------------------------
*     Date       Who       Version     Comments
* 1. 2016年11月9日    WangHuicheng    1.0
*
*
*
*
----------------------------------------------------------------------------------
*/
	
package com.yonyou.gmmc.dealerApp.api.controller;

import java.util.Map;

import org.marketing.common.dto.user.LoginUserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yonyou.gmmc.dealerApp.api.constant.DealerAppConstant;
import com.yonyou.gmmc.dealerApp.api.service.DealerAppLoginService;

/**
*
* @author WangHuicheng
* DealerApp用户登录API-接口
* @date 2016年11月9日
*/
@RestController
@RequestMapping(value = DealerAppConstant.BASE_PATH+"/login")
public class DealerAppLoginController {
    
    @Autowired
    private DealerAppLoginService dealerAppLoginServiceInterface;
    
    /**
    *
    * @author WangHuicheng
    * DealerApp用户登录
    * @date 2016年11月9日
    * @param askingPriceDto
    * @return
    * @throws Exception
    */
    @RequestMapping( value="/dealerAppUserLogin",method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public Map<String,Object> dealerAppUserLogin(@RequestBody LoginUserDto loginUserDto) throws Exception {
        Map<String,Object> resultMap = dealerAppLoginServiceInterface.dealerAppUserLogin(loginUserDto);
        return resultMap;
    }
    /**
     * 
    * 选择经销商确定TOKEN
    * @author WangHuicheng
    * @date 2016年12月19日
    * @param loginUserDto
    * @return
    * @throws Exception
     */
    @RequestMapping( value="/selectDealer",method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public Map<String,Object> selectDealer(@RequestBody LoginUserDto loginUserDto) throws Exception {
        Map<String,Object> resultMap = dealerAppLoginServiceInterface.selectDealer(loginUserDto);
        return resultMap;
    }


}
